package com.kanesoft.android.gdx.actors.fight;

public abstract class AutoBehaviorFight {

    protected final float MAX_JUMP_DISTANCE = 10f;
    protected final float MIN_JUMP_DISTANCE = 7f;
    protected final float MIN_KICK_DISTANCE = 3f;

    protected FightActorObject cpuPlayer;
    protected FightActorObject opponentPlayer;

    public AutoBehaviorFight(FightActorObject cpuPlayer, FightActorObject opponentPlayer) {
        this.cpuPlayer = cpuPlayer;
        this.opponentPlayer = opponentPlayer;
    }
    
    
    protected float getOpponentDistance() {

        float actorPosX = cpuPlayer.getActorBody().getPosition().x;
        float opponentPosX = opponentPlayer.getActorBody().getPosition().x;

        if (actorPosX < opponentPosX) { return (opponentPosX - actorPosX); }

        return (actorPosX - opponentPosX);
    }
    

    public abstract void updateCpuActions(float cpuSleep);

    protected class CpuActions {
        FightActorStateMachine cpuActualState;
        FightActorStateMachine opponentActualState;
        float minDistanceToExecute;
        float maxDistanceToExecute;
        FightActorStateMachine cpuNewState;

        protected CpuActions(FightActorStateMachine cpuActualState, FightActorStateMachine opponentActualState,
                float minDistanceToExecute, float maxDistanceToExecute, FightActorStateMachine cpuNewState) {
            this.cpuActualState = cpuActualState;
            this.opponentActualState = opponentActualState;
            this.minDistanceToExecute = minDistanceToExecute;
            this.maxDistanceToExecute = maxDistanceToExecute;
            this.cpuNewState = cpuNewState;
        }

    }

}
